#include "ReconstructionStruct.h"

//***********SurfaceValueClass*****************8
SurfaceValueClass::SurfaceValueClass(QWidget *parent,QGridLayout *gridLayout,int pos,QList<SurfaceValueClass*> *list)
{
	layout=gridLayout;
	label = new QLabel(parent);
	label->setObjectName(QString::fromUtf8("label"));
	//QString s="value"+QString::number(pos+1);
	QString s="value";
	label->setText(s); 
	label->show();
	gridLayout->addWidget(label, pos, 0, 1, 1);

	lineEdit= new QLineEdit(parent);
	lineEdit->setObjectName(QString::fromUtf8("lineEdit"));
	lineEdit->show();
	gridLayout->addWidget(lineEdit, pos, 1, 1, 1);

	button=new QToolButton(parent);
	button->setIcon(QIcon(":/MyQtItk/images/del.png"));
	button->show();
	connect(button,SIGNAL(clicked()),this,SLOT(deleteThisObject()));
	gridLayout->addWidget(button, pos, 2, 1, 1);
	listHead=list;
}
SurfaceValueClass::~SurfaceValueClass()
{	
	
	delete label;
	delete lineEdit;
	delete button;
	
}
void SurfaceValueClass::deleteThisObject()
{
	layout->removeWidget(label);
	layout->removeWidget(lineEdit);
	layout->removeWidget(button);
	
	listHead->removeOne(this);	
	button->hide();
	label->hide();
	lineEdit->hide();
	
}

//******************GrayOpacityClass***************
void GrayOpacityClass::deleteThisObject()
{
	listHead->removeOne(this);
	layout->removeWidget(label1);
	layout->removeWidget(label2);
	layout->removeWidget(label3);
	layout->removeWidget(lineEdit1);
	layout->removeWidget(lineEdit2);
	layout->removeWidget(button);
	button->hide();
	label1->hide();
	label2->hide();
	label3->hide();
	lineEdit1->hide();
	lineEdit2->hide();
}
GrayOpacityClass::GrayOpacityClass(QWidget *parent,QGridLayout *gridLayout,int pos,QList<GrayOpacityClass*> *list)
{
	layout=gridLayout;
	label1 = new QLabel(parent);
	label1->setObjectName(QString::fromUtf8("label"));
	label1->setText("Group Value:(");
	label1->show();
	gridLayout->addWidget(label1, pos, 0, 1, 1);
	label2 = new QLabel(parent);
	label2->setText(",");
	label2->show();
	gridLayout->addWidget(label2, pos, 2, 1, 1);
	label3 = new QLabel(parent);
	label3->setText(")");
	label3->show();
	gridLayout->addWidget(label3, pos, 4, 1, 1);

	lineEdit1= new QLineEdit(parent);
	lineEdit1->show();
	gridLayout->addWidget(lineEdit1, pos, 1, 1, 1);
	lineEdit2= new QLineEdit(parent);
	lineEdit2->setObjectName(QString::fromUtf8("lineEdit"));
	lineEdit2->show();
	gridLayout->addWidget(lineEdit2, pos, 3, 1, 1);

	button=new QToolButton(parent);
	button->setIcon(QIcon(":/MyQtItk/images/del.png"));
	button->show();
	connect(button,SIGNAL(clicked()),this,SLOT(deleteThisObject()));
	gridLayout->addWidget(button, pos, 5, 1, 1);
	listHead=list;
}
GrayOpacityClass::~GrayOpacityClass()
{
	
	delete label1;
	delete label2;
	delete label3;
	delete lineEdit1;
	delete lineEdit2;
	delete button;
	
}

//***************ColorValueClass********************
void ColorValueClass::deleteThisObject()
{
	listHead->removeOne(this);
	layout->removeWidget(label1);
	layout->removeWidget(label2);	
	layout->removeWidget(lineEdit1);
	layout->removeWidget(lineEdit2);
	layout->removeWidget(lineEdit3);
	layout->removeWidget(lineEdit4);
	layout->removeWidget(button);
	button->hide();
	label1->hide();
	label2->hide();
	lineEdit1->hide();
	lineEdit2->hide();
	lineEdit3->hide();
	lineEdit4->hide();
}
ColorValueClass::ColorValueClass(QWidget *parent,QGridLayout *gridLayout,int pos,QList<ColorValueClass*> *list)
{
	layout=gridLayout;
	label1 = new QLabel(parent);
	QString s="GroupValue:(";
	label1->setText(s);
	label1->show();
	gridLayout->addWidget(label1, pos, 0, 1, 1);
	label2 = new QLabel(parent);
	label2->setText(")");
	label2->show();
	gridLayout->addWidget(label2, pos, 5, 1, 1);

	lineEdit1= new QLineEdit(parent);
	lineEdit1->setMinimumSize(QSize(20, 20));
	lineEdit1->show();
	gridLayout->addWidget(lineEdit1, pos, 1, 1, 1);

	lineEdit2= new QLineEdit(parent);
	lineEdit2->setMinimumSize(QSize(20, 20));
	lineEdit2->show();
	gridLayout->addWidget(lineEdit2, pos, 2, 1, 1);
	lineEdit3= new QLineEdit(parent);
	lineEdit3->show();
	lineEdit3->setMinimumSize(QSize(20, 20));
	gridLayout->addWidget(lineEdit3, pos, 3, 1, 1);
	lineEdit4= new QLineEdit(parent);
	lineEdit4->show();
	lineEdit4->setMinimumSize(QSize(20, 20));
	gridLayout->addWidget(lineEdit4, pos, 4, 1, 1);

	button=new QToolButton(parent);
	button->setIcon(QIcon(":/MyQtItk/images/del.png"));
	button->show();
	connect(button,SIGNAL(clicked()),this,SLOT(deleteThisObject()));
	gridLayout->addWidget(button, pos, 6, 1, 1);
	listHead=list;
}
ColorValueClass::~ColorValueClass()
{
	delete label1;
	delete label2;
	delete lineEdit1;
	delete lineEdit2;
	delete lineEdit3;
	delete lineEdit4;
	delete button;

}
//*************GradientOpacityClass******************
void GradientOpacityClass::deleteThisObject()
{
	listHead->removeOne(this);
	layout->removeWidget(label1);
	layout->removeWidget(label2);
	layout->removeWidget(label3);
	layout->removeWidget(lineEdit1);
	layout->removeWidget(lineEdit2);
	layout->removeWidget(button);
	button->hide();
	label1->hide();
	label2->hide();
	label3->hide();
	lineEdit1->hide();
	lineEdit2->hide();
}
GradientOpacityClass::GradientOpacityClass(QWidget *parent,QGridLayout *gridLayout,int pos,QList<GradientOpacityClass*> *list)
{
	layout=gridLayout;
	label1 = new QLabel(parent);
	label1->setObjectName(QString::fromUtf8("label"));
	label1->setText("Group Value:(");
	label1->show();
	gridLayout->addWidget(label1, pos, 0, 1, 1);
	label2 = new QLabel(parent);
	label2->setText(",");
	label2->show();
	gridLayout->addWidget(label2, pos, 2, 1, 1);
	label3 = new QLabel(parent);
	label3->setText(")");
	label3->show();
	gridLayout->addWidget(label3, pos, 4, 1, 1);

	lineEdit1= new QLineEdit(parent);
	lineEdit1->show();
	gridLayout->addWidget(lineEdit1, pos, 1, 1, 1);
	lineEdit2= new QLineEdit(parent);
	lineEdit2->setObjectName(QString::fromUtf8("lineEdit"));
	lineEdit2->show();
	gridLayout->addWidget(lineEdit2, pos, 3, 1, 1);

	button=new QToolButton(parent);
	button->setIcon(QIcon(":/MyQtItk/images/del.png"));
	button->show();
	connect(button,SIGNAL(clicked()),this,SLOT(deleteThisObject()));
	gridLayout->addWidget(button, pos, 5, 1, 1);
	listHead=list;
}
GradientOpacityClass::~GradientOpacityClass()
{
	delete label1;
	delete label2;
	delete label3;
	delete lineEdit1;
	delete lineEdit2;
	delete button;
}